package com.ak.demo_2;

import com.ak.utils.RabbitMQUtils;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;

import java.io.IOException;

public class Demo2Provider {
    public static void main(String[] args) {
        Connection connection= RabbitMQUtils.getConnection();
        try {
            Channel channel=connection.createChannel();
            channel.queueDeclare("workquene",true,false,false,null);
            for(int i=0;i<10;i++){
                channel.basicPublish("","workquene",null,("hello"+i).getBytes());
            }
            RabbitMQUtils.closeConnectionAndChanel(channel,connection);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
